package com.visionblue.business.ship.model.repository.db

import androidx.lifecycle.LiveData
import androidx.room.*

/**
 * @author: xlh
 * @date: 2020-07-21 4:01 PM
 * @desc:
 */
@Dao
interface MeasureMenuItemDao {

    @Insert
    suspend fun insert(vararg measureMenuItem: MeasureMenuItem)

    @Query("SELECT * FROM measure_menu_items")
    suspend fun getAll(): List<MeasureMenuItem>

    @Update
    suspend fun update(measureMenuItem: MeasureMenuItem)

    @Query("SELECT * FROM measure_menu_items WHERE isOutput=:isOutput AND isChecked=:isChecked")
    suspend fun getAllByCondition(isOutput: Boolean, isChecked: Boolean): List<MeasureMenuItem>

    @Query("select * from measure_menu_items where name=:name")
    suspend fun getMeasureMenuItemByName(name: String): MeasureMenuItem

    @Delete
    suspend fun delete(vararg measureMenuItem: MeasureMenuItem)
}